package com.wsjzzcbq.ui.info;

import javax.swing.*;
import java.awt.*;
import java.util.Observable;
import java.util.Observer;

/**
 * WindowInfo
 *
 * @author wsjz
 * @date 2023/09/11
 */
public class WindowInfo implements Observer {

    private static JFrame jFrame;

    @Override
    public void update(Observable o, Object arg) {
        JframePublisher publisher = (JframePublisher)o;
        jFrame = publisher.getjFrame();
    }

    /**
     * 最外层frame jFrame.getLocationOnScreen() 和 jFrame.getLocation() 相同
     * @return
     */
    public static Point location() {
        return jFrame.getLocation();
    }
}
